package com.syh.jn.scm.service.api.supplier.purchase.enums;

import com.syh.jn.scm.service.api.supplier.sale.enums.SaleOrderEnums;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 采购订单的枚举接口
 */
public interface PurchaseOrderEnums {

  /**
   * 订单类型枚举 (0：普通采购 1：直采直销 )
   */
  @Getter
  @AllArgsConstructor
  enum OrderType {
    /**
     * 普通采购
     */
    COMMON_PURCHASE(Short.valueOf("0"), "普通采购", "采购订单"),
    /**
     * 直采直销
     */
    DIRECT_PURCHASE_AND_SALE(Short.valueOf("1"), "直采直销", "采购订单");


    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static OrderType valueOf(Short status) {
      switch (status) {
        case 0:
          return COMMON_PURCHASE;
        case 1:
          return DIRECT_PURCHASE_AND_SALE;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  enum OrdState {
    NOT_RECORD(Short.valueOf("0"), "未存在记录", "采购订单"),
    HAVE_RECORD(Short.valueOf("1"), "已存在记录", "采购订单"),

    STAYCONFIRM(Short.valueOf("0"), "待确认", "采购订单"),
    CONFIRM(Short.valueOf("1"), "已确认", "采购订单"),
    HANG(Short.valueOf("2"), "已挂起", "采购订单"),
    STATEMENT(Short.valueOf("3"), "已生成对账单", "采购订单"),
    CANCEL(Short.valueOf("-1"), "已取消订单", "采购订单");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static OrdState valueOf(Short status) {
      switch (status) {
        case 0:
          return STAYCONFIRM;
        case 1:
          return CONFIRM;
        case 2:
          return HANG;
        case 3:
          return STATEMENT;
        case -1:
          return CANCEL;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum GeneratedState {
    LOGISTICS_UN_GENERATE(Short.valueOf("0"),"未生成物流"),
    LOGISTICS_PART_GENERATE(Short.valueOf("1"),"部分生成物流"),
    LOGISTICS_WHOLE_GENERATE(Short.valueOf("2"),"全部生成物流");

    private Short status;
    private String statusName;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static GeneratedState valueOf(Short status) {
      switch (status) {
        case 0:
          return LOGISTICS_UN_GENERATE;
        case 1:
          return LOGISTICS_PART_GENERATE;
        case 2:
          return LOGISTICS_WHOLE_GENERATE;
      }
      return null;
    }
  }

  /**
   * 采购单物流状态
   */
  @Getter
  @AllArgsConstructor
  enum DeliveryState {
    LOGISTICS_UN_DELIVERY(Short.valueOf("0"), "未发货", "物流状态"),
    LOGISTICS_PART_DELIVEED(Short.valueOf("1"), "部分发货", "物流状态"),
    LOGISTICS_WHOLE_DELIVEED(Short.valueOf("2"), "全部发货", "物流状态");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static DeliveryState valueOf(Short status) {
      switch (status) {
        case 0:
          return LOGISTICS_UN_DELIVERY;
        case 1:
          return LOGISTICS_PART_DELIVEED;
        case 2:
          return LOGISTICS_WHOLE_DELIVEED;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum CollectState {
    LOGISTICS_UN_COLLECT(Short.valueOf("0"),"未签收"),
    LOGISTICS_PART_COLLECT(Short.valueOf("1"),"部分签收"),
    LOGISTICS_WHOLE_COLLECT(Short.valueOf("2"),"全部签收");

    private Short status;
    private String statusName;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static CollectState valueOf(Short status) {
      switch (status) {
        case 0:
          return LOGISTICS_UN_COLLECT;
        case 1:
          return LOGISTICS_PART_COLLECT;
        case 2:
          return LOGISTICS_WHOLE_COLLECT;
      }
      return null;
    }
  }
}
